// 导入 
import BaseAPI from './baseapi'
import request from '../utils/request';


// 继承类
class TaskOrderApi extends BaseAPI{

    constructor(appname:string, name: string) {
       super(appname, name);
    }

    // 当前类定义的函数 
    public get_new_orderid = () => {
        return request({
            method: 'get',
            url: `${this.appname}/${this.name}/new/taskid/`,
     
        })
    }

    // 取消taskorder 
    public cancel = (id: any) =>{
        return request({
            method: 'post',
            url: `${this.appname}/${this.name}/${id}/cancel/`
        })
    }
    
    // 暂停taskorder 
    public pause = (id: any) =>{
        return request({
            method: 'post',
            url: `${this.appname}/${this.name}/${id}/pause/`
        })
    }
    
    // 转移
    public transfer = (data:any) =>{
        return request({
            method: 'post',
            url: `${this.appname}/${this.name}/transfer/`,
            data
        })
    }

    // 提交
    public commit = (data:any) =>{
        return request({
            method: 'post',
            url: `${this.appname}/${this.name}/commit/`,
            data
        })
    }

    // 获取echarts数据
    public echarts = () =>{
        return request({
            method: 'get',
            url: `${this.appname}/echarts/`,
      
        })
    }
}
export default TaskOrderApi